<!DOCTYPE html>
<html>
<head>
    <title>{$platform.name}</title>
    <link href="/static/css/framework-font.css" rel="stylesheet"/>
    <script src="/static/js/jquery-2.1.1.js"></script>
    <script src="/static/bootstrap/js/bootstrap.js"></script>
    <link href="/static/bootstrap/css/bootstrap.min.css" rel="stylesheet"/>
    <!--    <link href="/static/css/dialog.css" rel="stylesheet"/>-->
    <!--    <script src="/static/js/dialog.js"></script>-->
    <script src="/static/js/jquery.cookie.js"></script>
    <link href="/static/css/framework-theme.css" rel="stylesheet"/>
    <script src="/static/js/framework-ui.js"></script>
    <script src="/static/js/framework-clientdata.js"></script>
    <script src="/static/js/yii.js"></script>

    <!--引用layui弹框插件-->
    <link href="/static/layui/css/layui.css" rel="stylesheet"/>
    <script src="/static/layui/layui.js"></script>



    <!--开关主键-->
    <script src="/static/bootstrap/bootstrap-switch.js"></script>
    <link href="/static/bootstrap/bootstrap-switch.css" rel="stylesheet"/>

    <!-- PNotify -->
    <script type="text/javascript" src="/static/pnotify/pnotify.js"></script>
    <link href="/static/pnotify/pnotify.css" rel="stylesheet" type="text/css"/>
    <link href="/static/pnotify/pnotify.brighttheme.css" rel="stylesheet" type="text/css"/>

        {if condition="$swidthStyle eq 0"}
    <link href="/static/css/pattern/public.css" rel="stylesheet"/>
    {else/}
        {if condition="$swidthStyle eq 0"}
    <link href="/static/css/pattern/public.css" rel="stylesheet"/>
    {else/}
    <link href="/static/css/default/public.css" rel="stylesheet"/>
    {/if}
    {/if}
</head>
<body>

<!--<div class="modal-header">-->
<!--&lt;!&ndash;    <button type="button" class="close" data-dismiss="modal" close="true">&ndash;&gt;-->
<!--&lt;!&ndash;        <span aria-hidden="true">×</span>&ndash;&gt;-->
<!--&lt;!&ndash;    </button>&ndash;&gt;-->
<!--    <h4 class="modal-title">-->
<!--        <span class="fa fa-legal"></span>&nbsp;微信配置-->
<!--    </h4>-->
<!--</div>-->
<style>
    html,body{height:100%}
    .modal-body{background-color:#fff!important;height:80%}
    .form-horizontal .control-label{display: inline-block;width:10%;
        text-align:justify!important;
        text-align-last:justify;/*解决IE的支持*/ }
    .title{font-size:16px;background-color:#fff;margin:15px 0px;line-height:45px;padding-left:30px;}
    .zxd_label{float: left;line-height:35px;}
    .layui-input-block{margin-left:150px!important;}
    .layui-form-item{border-bottom:1px #ccc dashed}
    .modal-div{display: inline-block;width:100%;background-color:#fff;padding:15px 30px;}
    .modal_label .zxd_label{width:70px!important;}
</style>
<div class="title">
    门票配置
</div>
<div class="modal-div">
    <div class="layui-form" action="">
        <div class="layui-form-item">
            <label class="zxd_label">强制校验发卡库:</label>
            <div class="layui-input-block">
                <input type="checkbox" name="open" lay-skin="switch" lay-filter="switchTest" lay-text="ON|OFF" {if condition="$config['checkout_status'] eq 1"} checked=""  {/if}>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="zxd_label">是否开启人脸认证:</label>
            <div class="layui-input-block">
                <input type="checkbox" name="face_type" lay-skin="switch" lay-filter="face_type" lay-text="ON|OFF" {if condition="$config['face_type'] eq 1"} checked=""  {/if}>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="zxd_label">门票类型:</label>
            <div class="layui-col-md4" style="margin-left: 80px;">
                <input name="tickets_type" value="{$config.tickets_type}" class="layui-input">
                <p style="display: block">格式1:临时票|2:临时票</p>
            </div>
            <button type="button" class="layui-btn" id="update" >更新配置</button>
        </div>
    </div>
</div>

<div class="title">
    PDA配置
</div>
<div class="modal-div modal_label">
    <form class="layui-form" action="">
        <div class="layui-form-item">
            <label class="zxd_label">appKey:</label>
            <div class="layui-input-block layui-col-md4" style="margin-left: 80px!important;" >
                <input type="text" name="appKey" value="{$config.appKey}" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="zxd_label">appSecret:</label>
            <div class="layui-input-block layui-col-md4" style="margin-left: 80px!important;" >
                <input type="text" name="appSecret" value="{$config.appSecret}" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="zxd_label">headip:</label>
            <div class="layui-input-block layui-col-md4" style="margin-left: 80px!important;" >
                <input type="text" name="headip" value="{$config.headip}" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="zxd_label">headipbak:</label>
            <div class="layui-input-block layui-col-md4" style="margin-left: 80px!important;" >
                <input type="text" name="headipbak" value="{$config.headipbak}" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="zxd_label">headipport:</label>
            <div class="layui-input-block layui-col-md4" style="margin-left: 80px!important;" >
                <input type="text" name="headipport" value="{$config.headipport}" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="zxd_label">auto:</label>
            <div class="layui-input-block layui-col-md4" style="margin-left: 80px!important;" >
                <input type="checkbox" name="auto" {if condition="$config['auto'] eq true"} checked="" {/if}lay-skin="switch" lay-filter="switchTest" lay-text="ON|OFF" >
            </div>
        </div>

        <div class="layui-form-item">
            <label class="zxd_label">time:</label>
            <div class="layui-input-block layui-col-md4" style="margin-left: 80px!important;" >
                <input type="text" name="time" value="{$config.time}" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="zxd_label"></label>
            <div class="layui-input-block layui-col-md4" style="margin-left: 80px!important;" >
                <button type="button" class="layui-btn" id="pda_update" >更新配置</button>
            </div>
        </div>
    </form>
</div>


<script>
    layui.use(['form', 'layedit', 'laydate'], function(){
        var form = layui.form;

        form.on('switch(face_type)', function(data){
            var status = this.checked;
            $.ajax({
                type: 'post',
                url: "{:URL('tickets/Config/faceType')}",
                data: {face_type:status},
                dataType: 'JSON',
                success: function (res) {
                    layer.alert(res.msg);
                },
            });
        });

        //监听指定开关
        form.on('switch(switchTest)', function(data){
            var status = this.checked;
            $.ajax({
                type: 'post',
                url: "{:URL('tickets/Config/newClick')}",
                data: {status:status},
                dataType: 'JSON',
                success: function (res) {
                    layer.alert(res.msg);
                },
            });
        });

        $("#update").click(function () {
            var tickets_type = $("input[name='tickets_type']").val();
            $.ajax({
                type: 'post',
                url: "{:URL('tickets/Config/updateType')}",
                data: {tickets_type:tickets_type},
                dataType: 'JSON',
                success: function (res) {
                    layer.alert(res.msg);
                },
            });
        });

        $("#pda_update").click(function () {
            var data = $("form").serializeArray();
            $.ajax({
                type: 'post',
                url: "{:URL('tickets/Config/updateConfig')}",
                data: data,
                dataType: 'JSON',
                success: function (res) {
                    layer.alert(res.msg);
                },
            });
        });


    });
</script>
</body>
</html>
